package com.jvm;

/*首
被动使用类字段演示一:
通过子类引用父类的静态字段，不会导致子类初始化**/
public class SuperClass {
    static {
        System.out.println("superClass init!");
    }

    public static int value = 123;
}

class SubClass extends SuperClass {
    static {
        System.out.println("subClass init !");
    }
}

/**
 * 非主动使用类字段演示★
 */
class NotInitialization {
    public static void main(String[] args) {
        System.out.println(SubClass.value);
    }
}